<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use App\Console\Commands\IEC104Cmd;
use App\Console\Commands\NariDataReportCmd;
use App\Console\Commands\GrabGarbageCmd;
use App\Console\Commands\GrabGarbageReportCmd;
use App\Console\Commands\DcsDataCmd;
use App\Console\Commands\DcsDataReportCmd;
use App\Console\Commands\AvsDataCmd;
use App\Console\Commands\AvsDataReportCmd;
use App\Console\Commands\RegionDataCmd;
use App\Console\Commands\SourceDataCmd;

class Kernel extends ConsoleKernel
{

    protected $commands = [
        IEC104Cmd::class,
        NariDataReportCmd::class,
        GrabGarbageCmd::class,
        GrabGarbageReportCmd::class,
        DcsDataCmd::class,
        DcsDataReportCmd::class,
        AvsDataCmd::class,
        AvsDataReportCmd::class,
        RegionDataCmd::class,
        SourceDataCmd::class
    ];


    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('collect:iec104')->everyFiveMinutes();
        $schedule->command('collect:grabGarbage')->everyFiveMinutes();
        $schedule->command('naridata:report')->everyMinute();
        $schedule->command('grabgarbage:report')->everyMinute();
        $schedule->command('collect:dcsData')->everyFiveMinutes();
        $schedule->command('dcsdata:report')->everyMinute();
        $schedule->command('collect:avsdata')->everyFiveMinutes();
        $schedule->command('avsdata:report')->everyMinute();
        $schedule->command('collect:regionData')->dailyAt("8");
        $schedule->command('collect:regionData')->dailyAt("12");
        $schedule->command('collect:regionData')->dailyAt("18");
        $schedule->command('collect:sourceData')->dailyAt("8");
        $schedule->command('collect:sourceData')->dailyAt("12");
        $schedule->command('collect:sourceData')->dailyAt("18");

    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
